package com.zp.self.module.令牌桶.controller;

import com.zp.self.module.令牌桶.service.ISysUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author By ZengPeng
 * @Description
 * @date in  2021/3/30 21:50
 * @Modified By
 */
@RestController
public class TestPermission {
    @Resource
    ISysUserService iSysUserService;

    /**
     * 根据用户编号获取详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:user:query')")
    @GetMapping(value = {"/", "/{userId}"})
    public Object getInfo(@PathVariable(value = "userId", required = false) Long userId) {
        return iSysUserService.getById(userId);
    }
}
